home *** CD-ROM | disk | FTP | other *** search
- ; functions
-
- ; setenv:
- ; #savemode: =0 writes to ENVARC: too
- ; #varname: name of the variable to affect
- ; #varvalue: required value
-
- (procedure p_setenv #varname #varvalue
- (run ("setenv %s \"%s\"" #varname #varvalue))
- )
-
- ; get environment variables
-
- (set #authorname (getenv "INSW/AUTHORNAME"))
- (set #authoremail (getenv "INSW/AUTHOREMAIL"))
- (set #editor (getenv "INSW/EDITOR"))
- (set #installroot (getenv "INSW/INSTALLROOT"))
- (set #loaderdevroot (getenv "INSW/LOADERDEVROOT"))
-
- ; user prompts
-
- (set #authorname
- (askstring (prompt "What's your name ?")
- (help
- "This name string will be used to author your installs/readmes\n"
- "The general format is <firstname(s)> <name> (e.g: William H. Gates)")
- (default #authorname)
- )
- )
-
- (set #authoremail
- (askstring (prompt "What's your email address ?")
- (help "This e-mail string will be used to author your readmes")
- (default #authoremail)
- )
- )
-
- (set #editor
- (askstring (prompt "What's your editor command/path ?")
- (help "This editor will be used to edit readme and\n"
- " to set default tool on developper text files")
- (default #editor)
- )
- )
-
- (set #installroot
- (askdir (prompt "Where should the user install files be generated ?")
- (help "This dir will be used as a parent for your user install dirs")
- (default #installroot)
- )
- )
-
- (set #loaderdevroot
- (askdir (prompt "Where should the developper install files be generated ?")
- (help "This dir will be used as a parent for your developper install dirs")
- (default #loaderdevroot)
- )
- )
-
- (message ("\nYou selected the following:\n\nUser name: %s\nUser e-mail: %s\n\nUser install root: %s\nDevelopper install root: %s\n\nEditor to use: %s"
- #authorname #authoremail #installroot #loaderdevroot #editor)
- )
-
- (set #savemode
- (askbool (prompt "Do you want to set the environment variables\n"
- "or to set them and save them (ENVARC:)?"
- )
- (help "Select \"Abort install\" to cancel everything")
- (choices "Set only" "Set and save")
- )
- )
-
- (p_setenv "INSW/AUTHORNAME" #authorname)
- (p_setenv "INSW/AUTHOREMAIL" #authoremail)
- (p_setenv "INSW/EDITOR" #editor)
- (p_setenv "INSW/INSTALLROOT" #installroot)
- (p_setenv "INSW/LOADERDEVROOT" #loaderdevroot)
-
- (if (= 0 #savemode)
- (
- (makedir "ENVARC:INSW")
- (copyfiles (help @copyfiles-help)
- (source "ENV:INSW") (dest "ENVARC:INSW") (all)
- )
- )
- )
-